import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
/* 系统配置-黑名单管理
---------------------------------------------------------------- */
import { BlackListInfo, GetBlackListRequest } from '../../schema/BlackList';
/**新增黑名单 */
export const createBlackList = (data: { phoneNumber: string }): Promise<any> => {
  return $http.post({
    url: '/icms/blacklistmanage/blacklist',
    data,
  });
};

/**删除黑名单 */
export const deleteBlackList = (id: number): Promise<Result<null>> => {
  return $http.delete({
    url: `/icms/blacklistmanage/blacklists/${id}`,
  });
};
/**批量删除黑名单 */
export const mulDelBlackList = (data: number[]): Promise<Result<null>> => {
  return $http.delete({
    url: '/icms/blacklistmanage/blacklists',
    data: { blackListId: data },
  });
};
/**查询黑名单列表 */
export const getBlackLists = (data: GetBlackListRequest): Promise<Result<BlackListInfo[]>> => {
  return $http.get({
    url: '/icms/blacklistmanage/blacklists',
    data,
  });
};

/**批量导入黑名单 */
export const uploadBlackList = (data: any): Promise<any> => {
  return $http.post({
    url: '/icms/blacklistmanage/blacklists',
    data,
  });
};
